From 69f42512fa819749e1a2ca9f27a1b940ca8fc0d6 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Mon, 6 Nov 2000 16:44:01 +0000 Subject: [PATCH] Derive from GtkDialog, and use stock buttons. Should be 100% source 2000-11-02 Havoc Pennington * gtk/gtkfilesel.h, gtk/gtkfilesel.c: Derive from GtkDialog, and use stock buttons. Should be 100% source compatible, appropriate filesel fields now point to dialog->vbox and dialog->action_area. On the bizarre side, dialog->action_area and filesel->action_area are not the same widget. (gtk_file_selection_init): Put some padding around the selection entry, so it isn't touching the GtkDialog separator. * gtk/gtkfontsel.h, gtk/gtkfontsel.c: Derive from GtkDialog, use stock buttons, etc. Should also be source compatible. Set the dialog default title in _init not _new(). * gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): Use stock buttons; don't put a button box inside the existing dialog button box. Don't bother with push/pop colormap anymore. * gtk/gtkdialog.h (GtkResponseType): Add a bunch of more specific GTK_RESPONSE_* values. This is clearer than ACCEPT/REJECT for message dialog, and necessary for the font selection and color selection with help and apply buttons. * gtk/gtkdialog.c (gtk_dialog_add_button): Return a pointer to the created button widget. Set GTK_CAN_DEFAULT on the button. (gtk_dialog_init): Default to GTK_BUTTONBOX_END, put less spacing between buttons, put less padding around the action area. (gtk_dialog_run): Exit on unmap rather than on destroy. This will also exit the loop if the widget is hidden. (gtk_dialog_delete_event_handler): Use GTK_RESPONSE_DELETE_EVENT instead of GTK_RESPONSE_NONE; since we're already adding a bunch of GTK_RESPONSE_* stuff, this seems cleaner, and lets you special-case delete event. * gtk/gtktexttagtable.c, gtk/gtktextview.c: Fix doc comment formatting --- ChangeLog | 37 + ChangeLog.pre-2-0 | 37 + ChangeLog.pre-2-10 | 37 + ChangeLog.pre-2-2 | 37 + ChangeLog.pre-2-4 | 37 + ChangeLog.pre-2-6 | 37 + ChangeLog.pre-2-8 | 37 + docs/reference/gtk/gtk.hierarchy | 4 +- docs/reference/gtk/tmpl/gtk-unused.sgml | 1708 +++++++++++------------ docs/reference/gtk/tmpl/gtkdialog.sgml | 9 + gtk/gtkcolorseldialog.c | 38 +- gtk/gtkdialog.c | 30 +- gtk/gtkdialog.h | 46 +- gtk/gtkfilesel.c | 37 +- gtk/gtkfilesel.h | 6 +- gtk/gtkfontsel.c | 61 +- gtk/gtkfontsel.h | 7 +- gtk/gtkmessagedialog.c | 22 +- gtk/gtktexttagtable.c | 1 + gtk/gtktextview.c | 1 + 20 files changed, 1251 insertions(+), 978 deletions(-) diff --git a/ChangeLog b/ChangeLog index a1d0f47ebb..96c995d9b7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,40 @@ +2000-11-02 Havoc Pennington + + * gtk/gtkfilesel.h, gtk/gtkfilesel.c: Derive from GtkDialog, and + use stock buttons. Should be 100% source compatible, appropriate + filesel fields now point to dialog->vbox and dialog->action_area. + On the bizarre side, dialog->action_area and filesel->action_area + are not the same widget. + (gtk_file_selection_init): Put some padding around the selection + entry, so it isn't touching the GtkDialog separator. + + * gtk/gtkfontsel.h, gtk/gtkfontsel.c: Derive from GtkDialog, + use stock buttons, etc. Should also be source compatible. + Set the dialog default title in _init not _new(). + + * gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): + Use stock buttons; don't put a button box inside the existing + dialog button box. Don't bother with push/pop colormap anymore. + + * gtk/gtkdialog.h (GtkResponseType): Add a bunch of more + specific GTK_RESPONSE_* values. This is clearer than ACCEPT/REJECT + for message dialog, and necessary for the font selection and color + selection with help and apply buttons. + + * gtk/gtkdialog.c (gtk_dialog_add_button): Return a pointer + to the created button widget. Set GTK_CAN_DEFAULT on the button. + (gtk_dialog_init): Default to GTK_BUTTONBOX_END, put less spacing + between buttons, put less padding around the action area. + (gtk_dialog_run): Exit on unmap rather than on destroy. + This will also exit the loop if the widget is hidden. + (gtk_dialog_delete_event_handler): Use GTK_RESPONSE_DELETE_EVENT + instead of GTK_RESPONSE_NONE; since we're already adding a bunch + of GTK_RESPONSE_* stuff, this seems cleaner, and lets you + special-case delete event. + + * gtk/gtktexttagtable.c, gtk/gtktextview.c: Fix doc comment + formatting + Sun Nov 5 05:32:39 2000 Tim Janik * gtk/testgtk.c (uposition_stop_configure): provide a toggle diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index a1d0f47ebb..96c995d9b7 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,40 @@ +2000-11-02 Havoc Pennington + + * gtk/gtkfilesel.h, gtk/gtkfilesel.c: Derive from GtkDialog, and + use stock buttons. Should be 100% source compatible, appropriate + filesel fields now point to dialog->vbox and dialog->action_area. + On the bizarre side, dialog->action_area and filesel->action_area + are not the same widget. + (gtk_file_selection_init): Put some padding around the selection + entry, so it isn't touching the GtkDialog separator. + + * gtk/gtkfontsel.h, gtk/gtkfontsel.c: Derive from GtkDialog, + use stock buttons, etc. Should also be source compatible. + Set the dialog default title in _init not _new(). + + * gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): + Use stock buttons; don't put a button box inside the existing + dialog button box. Don't bother with push/pop colormap anymore. + + * gtk/gtkdialog.h (GtkResponseType): Add a bunch of more + specific GTK_RESPONSE_* values. This is clearer than ACCEPT/REJECT + for message dialog, and necessary for the font selection and color + selection with help and apply buttons. + + * gtk/gtkdialog.c (gtk_dialog_add_button): Return a pointer + to the created button widget. Set GTK_CAN_DEFAULT on the button. + (gtk_dialog_init): Default to GTK_BUTTONBOX_END, put less spacing + between buttons, put less padding around the action area. + (gtk_dialog_run): Exit on unmap rather than on destroy. + This will also exit the loop if the widget is hidden. + (gtk_dialog_delete_event_handler): Use GTK_RESPONSE_DELETE_EVENT + instead of GTK_RESPONSE_NONE; since we're already adding a bunch + of GTK_RESPONSE_* stuff, this seems cleaner, and lets you + special-case delete event. + + * gtk/gtktexttagtable.c, gtk/gtktextview.c: Fix doc comment + formatting + Sun Nov 5 05:32:39 2000 Tim Janik * gtk/testgtk.c (uposition_stop_configure): provide a toggle diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index a1d0f47ebb..96c995d9b7 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,40 @@ +2000-11-02 Havoc Pennington + + * gtk/gtkfilesel.h, gtk/gtkfilesel.c: Derive from GtkDialog, and + use stock buttons. Should be 100% source compatible, appropriate + filesel fields now point to dialog->vbox and dialog->action_area. + On the bizarre side, dialog->action_area and filesel->action_area + are not the same widget. + (gtk_file_selection_init): Put some padding around the selection + entry, so it isn't touching the GtkDialog separator. + + * gtk/gtkfontsel.h, gtk/gtkfontsel.c: Derive from GtkDialog, + use stock buttons, etc. Should also be source compatible. + Set the dialog default title in _init not _new(). + + * gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): + Use stock buttons; don't put a button box inside the existing + dialog button box. Don't bother with push/pop colormap anymore. + + * gtk/gtkdialog.h (GtkResponseType): Add a bunch of more + specific GTK_RESPONSE_* values. This is clearer than ACCEPT/REJECT + for message dialog, and necessary for the font selection and color + selection with help and apply buttons. + + * gtk/gtkdialog.c (gtk_dialog_add_button): Return a pointer + to the created button widget. Set GTK_CAN_DEFAULT on the button. + (gtk_dialog_init): Default to GTK_BUTTONBOX_END, put less spacing + between buttons, put less padding around the action area. + (gtk_dialog_run): Exit on unmap rather than on destroy. + This will also exit the loop if the widget is hidden. + (gtk_dialog_delete_event_handler): Use GTK_RESPONSE_DELETE_EVENT + instead of GTK_RESPONSE_NONE; since we're already adding a bunch + of GTK_RESPONSE_* stuff, this seems cleaner, and lets you + special-case delete event. + + * gtk/gtktexttagtable.c, gtk/gtktextview.c: Fix doc comment + formatting + Sun Nov 5 05:32:39 2000 Tim Janik * gtk/testgtk.c (uposition_stop_configure): provide a toggle diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index a1d0f47ebb..96c995d9b7 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,40 @@ +2000-11-02 Havoc Pennington + + * gtk/gtkfilesel.h, gtk/gtkfilesel.c: Derive from GtkDialog, and + use stock buttons. Should be 100% source compatible, appropriate + filesel fields now point to dialog->vbox and dialog->action_area. + On the bizarre side, dialog->action_area and filesel->action_area + are not the same widget. + (gtk_file_selection_init): Put some padding around the selection + entry, so it isn't touching the GtkDialog separator. + + * gtk/gtkfontsel.h, gtk/gtkfontsel.c: Derive from GtkDialog, + use stock buttons, etc. Should also be source compatible. + Set the dialog default title in _init not _new(). + + * gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): + Use stock buttons; don't put a button box inside the existing + dialog button box. Don't bother with push/pop colormap anymore. + + * gtk/gtkdialog.h (GtkResponseType): Add a bunch of more + specific GTK_RESPONSE_* values. This is clearer than ACCEPT/REJECT + for message dialog, and necessary for the font selection and color + selection with help and apply buttons. + + * gtk/gtkdialog.c (gtk_dialog_add_button): Return a pointer + to the created button widget. Set GTK_CAN_DEFAULT on the button. + (gtk_dialog_init): Default to GTK_BUTTONBOX_END, put less spacing + between buttons, put less padding around the action area. + (gtk_dialog_run): Exit on unmap rather than on destroy. + This will also exit the loop if the widget is hidden. + (gtk_dialog_delete_event_handler): Use GTK_RESPONSE_DELETE_EVENT + instead of GTK_RESPONSE_NONE; since we're already adding a bunch + of GTK_RESPONSE_* stuff, this seems cleaner, and lets you + special-case delete event. + + * gtk/gtktexttagtable.c, gtk/gtktextview.c: Fix doc comment + formatting + Sun Nov 5 05:32:39 2000 Tim Janik * gtk/testgtk.c (uposition_stop_configure): provide a toggle diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index a1d0f47ebb..96c995d9b7 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,40 @@ +2000-11-02 Havoc Pennington + + * gtk/gtkfilesel.h, gtk/gtkfilesel.c: Derive from GtkDialog, and + use stock buttons. Should be 100% source compatible, appropriate + filesel fields now point to dialog->vbox and dialog->action_area. + On the bizarre side, dialog->action_area and filesel->action_area + are not the same widget. + (gtk_file_selection_init): Put some padding around the selection + entry, so it isn't touching the GtkDialog separator. + + * gtk/gtkfontsel.h, gtk/gtkfontsel.c: Derive from GtkDialog, + use stock buttons, etc. Should also be source compatible. + Set the dialog default title in _init not _new(). + + * gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): + Use stock buttons; don't put a button box inside the existing + dialog button box. Don't bother with push/pop colormap anymore. + + * gtk/gtkdialog.h (GtkResponseType): Add a bunch of more + specific GTK_RESPONSE_* values. This is clearer than ACCEPT/REJECT + for message dialog, and necessary for the font selection and color + selection with help and apply buttons. + + * gtk/gtkdialog.c (gtk_dialog_add_button): Return a pointer + to the created button widget. Set GTK_CAN_DEFAULT on the button. + (gtk_dialog_init): Default to GTK_BUTTONBOX_END, put less spacing + between buttons, put less padding around the action area. + (gtk_dialog_run): Exit on unmap rather than on destroy. + This will also exit the loop if the widget is hidden. + (gtk_dialog_delete_event_handler): Use GTK_RESPONSE_DELETE_EVENT + instead of GTK_RESPONSE_NONE; since we're already adding a bunch + of GTK_RESPONSE_* stuff, this seems cleaner, and lets you + special-case delete event. + + * gtk/gtktexttagtable.c, gtk/gtktextview.c: Fix doc comment + formatting + Sun Nov 5 05:32:39 2000 Tim Janik * gtk/testgtk.c (uposition_stop_configure): provide a toggle diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index a1d0f47ebb..96c995d9b7 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,40 @@ +2000-11-02 Havoc Pennington + + * gtk/gtkfilesel.h, gtk/gtkfilesel.c: Derive from GtkDialog, and + use stock buttons. Should be 100% source compatible, appropriate + filesel fields now point to dialog->vbox and dialog->action_area. + On the bizarre side, dialog->action_area and filesel->action_area + are not the same widget. + (gtk_file_selection_init): Put some padding around the selection + entry, so it isn't touching the GtkDialog separator. + + * gtk/gtkfontsel.h, gtk/gtkfontsel.c: Derive from GtkDialog, + use stock buttons, etc. Should also be source compatible. + Set the dialog default title in _init not _new(). + + * gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): + Use stock buttons; don't put a button box inside the existing + dialog button box. Don't bother with push/pop colormap anymore. + + * gtk/gtkdialog.h (GtkResponseType): Add a bunch of more + specific GTK_RESPONSE_* values. This is clearer than ACCEPT/REJECT + for message dialog, and necessary for the font selection and color + selection with help and apply buttons. + + * gtk/gtkdialog.c (gtk_dialog_add_button): Return a pointer + to the created button widget. Set GTK_CAN_DEFAULT on the button. + (gtk_dialog_init): Default to GTK_BUTTONBOX_END, put less spacing + between buttons, put less padding around the action area. + (gtk_dialog_run): Exit on unmap rather than on destroy. + This will also exit the loop if the widget is hidden. + (gtk_dialog_delete_event_handler): Use GTK_RESPONSE_DELETE_EVENT + instead of GTK_RESPONSE_NONE; since we're already adding a bunch + of GTK_RESPONSE_* stuff, this seems cleaner, and lets you + special-case delete event. + + * gtk/gtktexttagtable.c, gtk/gtktextview.c: Fix doc comment + formatting + Sun Nov 5 05:32:39 2000 Tim Janik * gtk/testgtk.c (uposition_stop_configure): provide a toggle diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index a1d0f47ebb..96c995d9b7 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,40 @@ +2000-11-02 Havoc Pennington + + * gtk/gtkfilesel.h, gtk/gtkfilesel.c: Derive from GtkDialog, and + use stock buttons. Should be 100% source compatible, appropriate + filesel fields now point to dialog->vbox and dialog->action_area. + On the bizarre side, dialog->action_area and filesel->action_area + are not the same widget. + (gtk_file_selection_init): Put some padding around the selection + entry, so it isn't touching the GtkDialog separator. + + * gtk/gtkfontsel.h, gtk/gtkfontsel.c: Derive from GtkDialog, + use stock buttons, etc. Should also be source compatible. + Set the dialog default title in _init not _new(). + + * gtk/gtkcolorseldialog.c (gtk_color_selection_dialog_init): + Use stock buttons; don't put a button box inside the existing + dialog button box. Don't bother with push/pop colormap anymore. + + * gtk/gtkdialog.h (GtkResponseType): Add a bunch of more + specific GTK_RESPONSE_* values. This is clearer than ACCEPT/REJECT + for message dialog, and necessary for the font selection and color + selection with help and apply buttons. + + * gtk/gtkdialog.c (gtk_dialog_add_button): Return a pointer + to the created button widget. Set GTK_CAN_DEFAULT on the button. + (gtk_dialog_init): Default to GTK_BUTTONBOX_END, put less spacing + between buttons, put less padding around the action area. + (gtk_dialog_run): Exit on unmap rather than on destroy. + This will also exit the loop if the widget is hidden. + (gtk_dialog_delete_event_handler): Use GTK_RESPONSE_DELETE_EVENT + instead of GTK_RESPONSE_NONE; since we're already adding a bunch + of GTK_RESPONSE_* stuff, this seems cleaner, and lets you + special-case delete event. + + * gtk/gtktexttagtable.c, gtk/gtktextview.c: Fix doc comment + formatting + Sun Nov 5 05:32:39 2000 Tim Janik * gtk/testgtk.c (uposition_stop_configure): provide a toggle diff --git a/docs/reference/gtk/gtk.hierarchy b/docs/reference/gtk/gtk.hierarchy index 9f808f4bce..8c2379d4a3 100644 --- a/docs/reference/gtk/gtk.hierarchy +++ b/docs/reference/gtk/gtk.hierarchy @@ -27,9 +27,9 @@ GtkObject GtkWindow GtkDialog GtkColorSelectionDialog + GtkFileSelection + GtkFontSelectionDialog GtkInputDialog - GtkFileSelection - GtkFontSelectionDialog GtkPlug GtkEventBox GtkHandleBox diff --git a/docs/reference/gtk/tmpl/gtk-unused.sgml b/docs/reference/gtk/tmpl/gtk-unused.sgml index f4234a59cc..d3873e1341 100644 --- a/docs/reference/gtk/tmpl/gtk-unused.sgml +++ b/docs/reference/gtk/tmpl/gtk-unused.sgml @@ -1,304 +1,329 @@ - -Menu Factory + +Debugging - - + - -@obj: - + -@object: -@func: -@func_data: -@args: - + + +What are Signal Marshallers? - +Marshals are functions which all have the same prototype: +they take a #GtkObject, a #GtkSignalFunc, a #gpointer, +and an array of argument values. +The functions are names gtk_marshall_RETURNTYPE__PARAMTYPE1_PARAMTYPE2.... - -@buffer: -@override_location: -@time: -@interactive: -@default_editable: - - - +They then call a native function: the GtkObject is the first +parameter passed in. The arguments are passed in the native +calling convention: chars, shorts, ints, longs may be packed +on the stack, or tucked in registers: it doesn't matter +because the same calling convention will be generated +inside the gtkmarshal code as is expected where you define +your handlers. - -@GTK_TEXT_SCROLL_TO_TOP: -@GTK_TEXT_SCROLL_TO_BOTTOM: -@GTK_TEXT_SCROLL_PAGE_DOWN: -@GTK_TEXT_SCROLL_PAGE_UP: - - +So the function named: + +gtk_marshal_BOOL__POINTER_INT_INT_UINT(GtkObject*, GtkSignalFunc, gpointer, GtkArg*); + +will call the #GtkSignalFunc assuming it was a function with signature: + +gboolean sigfunc(gpointer,gint,gint,guint); + + + + +Writing Custom Marshals + +Marshals are primarily used as arguments to gtk_signal_new(). +Sometimes, you may find that a marshaller you need isn't available +in the standard list. Then you have to write your own. + + +If you wish to define a signal with a new type of argument list. +Suppose you want 2 pointers and 2 integers. +You would write: + +typedef int (*GtkSignal_INT__POINTER_POINTER_INT_INT)( + gpointer, gpointer, gint, gint +); +void marshal_INT__POINTER_POINTER_INT_INT(GtkObject* object, + GtkSignalFunc func, + gpointer func_data, + GtkArg* args) +{ + GtkSignal_NONE__POINTER_POINTER_INT_INT rfunc; + gint* return_val; + return_val = GTK_RETLOC_INT(args[4]); + rfunc = (GtkSignal_INT__POINTER_POINTER_INT_INT)func; + *return_val = (*rfunc)(object, + GTK_VALUE_POINTER(args[0]), + GTK_VALUE_POINTER(args[1]), + GTK_VALUE_INT(args[2]), + GTK_VALUE_INT(args[3]), + func_data); +} + + -@v: - - + - -@path: -@type: -@accel_group: -@widget: -@subfactories: - + -@widget: -@selection: - + -@object: -@func: -@func_data: -@args: +@wid: +@flag: - + -@buffer: -@regexp: -@start: -@end: -@Returns: +@obj: - + -@buffer: -@iter: -@str: -@start: -@end: @Returns: - + -@buffer: - + +@textview: the object which received the signal. +@arg1: - + -@container: +@v: +@visual: - + -@object: -@func: -@func_data: -@args: +@window: +@focus: - + -@object: -@func: -@func_data: -@args: - + -@object: -@func: -@func_data: -@args: - + - + -A set of bit flags used to specify the type of fonts shown -when calling gtk_font_selection_dialog_set_filter() or -gtk_font_selection_set_filter(). +Sets one of the two font filters, to limit the fonts shown. -@GTK_FONT_BITMAP: bitmap fonts. -@GTK_FONT_SCALABLE: scalable fonts. -@GTK_FONT_SCALABLE_BITMAP: scaled bitmap fonts. -@GTK_FONT_ALL: a bitwise combination of all of the above. +@fontsel: a #GtkFontSelection. +@filter_type: which of the two font filters to set, either +#GTK_FONT_FILTER_BASE or #GTK_FONT_FILTER_USER. The user filter +can be changed by the user, but the base filter is permanent. +@font_type: the types of font to be shown. This is a bitwise combination of +#GTK_FONT_BITMAP, #GTK_FONT_SCALABLE and #GTK_FONT_SCALABLE_BITMAP, +or #GTK_FONT_ALL to show all three font types. +@foundries: a NULL-terminated array of strings containing foundry names which +will be shown, or NULL to show all foundries. +@weights: a NULL-terminated array of strings containing weight names which +will be shown, or NULL to show all weights. +@slants: a NULL-terminated array of strings containing slant names which +will be shown, or NULL to show all slants. +@setwidths: a NULL-terminated array of strings containing setwidth names which +will be shown, or NULL to show all setwidths. +@spacings: a NULL-terminated array of strings containing spacings which +will be shown, or NULL to show all spacings. +@charsets: a NULL-terminated array of strings containing charset names which +will be shown, or NULL to show all charsets. - + -Combine a fundemantal type and a sequence number to create a gtk type. + -@parent_t: -@seqno: +@container: - - + +Signal Marshallers - -@factory: -@path: -@Returns: + + - -GtkIMContextSimple + - + -Internal function used by #GtkHPaned and #GtkVPaned +A structure used to return values from @gtk_type_query. -@paned: -@allocation: -@child1_req: -@child2_req: +@type: +@type_name: +@object_size: +@class_size: - + -@textview: the object which received the signal. -@arg1: -@arg2: -@arg3: +@v: - + +@buffer: +@Returns: - + -Private: print debugging information while doing a gtk_object_ref() or -a gtk_object_unref(). + -@object: object to reference or unreference. -@func: name of caller's function to print (used within macros). -@dummy: unused. -@line: line number (used within macros). -@do_ref: whether to reference or unreference. +@object: +@func: +@func_data: +@args: - + - +This is currently a hack left in for a scheme wrapper library. +It may be removed. + + +Don't use it. +@object: The object which emits the signal. +@data: The user data associated with the hook. +@nparams: The number of parameters to the function. +@args: The actual values of the arguments. +@arg_types: The types of the arguments. +@return_type: The type of the return value from the function +or #GTK_TYPE_NONE for no return value. - + -The first structured enumerated type value. +Add an emission hook for a type of signal, for any object. +(with control of what happens when the hook is +destroyed). +@signal_id: the type of signal add the hook for. +@hook_func: the function to invoke to handle the hook. +@data: the user data passed in to hook_func. +@destroy: a function to invoke when the hook is destroyed, +to clean up any allocation done just for this +signal handler. +@Returns: the id (that you may pass as a parameter +to gtk_signal_remove_emission_hook()). - + -@mark: -@Returns: - - -Signal Marshallers - +@buffer: +@override_location: +@time: +@interactive: +@default_editable: - + +@object: +@func: +@func_data: +@args: - + @textview: the object which received the signal. -@arg1: - + +@text_view: +@iter: +@x: +@y: - -Private Information + - - + + +Get the type of GtkIdentifier. -@textview: the object which received the signal. -@arg1: +@Returns: GtkType -- the enumerated type of something. - + -Add an emission hook for a type of signal, for any object. -(with control of what happens when the hook is -destroyed). + -@signal_id: the type of signal add the hook for. -@hook_func: the function to invoke to handle the hook. -@data: the user data passed in to hook_func. -@destroy: a function to invoke when the hook is destroyed, -to clean up any allocation done just for this -signal handler. -@Returns: the id (that you may pass as a parameter -to gtk_signal_remove_emission_hook()). - + @@ -308,11 +333,17 @@ to gtk_signal_remove_emission_hook()). @func_data: @args: - -gtkenums.sgml + + + - +@object: +@func: +@func_data: +@args: + + @@ -322,126 +353,145 @@ gtkenums.sgml @func_data: @args: - + -Set the varargs type for a fundamental type @foreign_type. + -@foreign_type: Must be a GtkType with a sequence number of zero. Must not be a -fundamental type. -@varargs_type: Must be a GtkType which is either structured or flag, or NONE. +@mark: +@Returns: - + -@wid: -@flag: - + +@ruler: the gtkruler - + +@selection_data: +@str: @Returns: - + +@argc: +@argv: - + + +Register a new set of enum @values and give them the name in +@type_name. + + +@type_name: must not be null. +@values: GtkEnumValue* +@Returns: + + +Menu Factory + + + -@GTK_MENU_FACTORY_MENU: -@GTK_MENU_FACTORY_MENU_BAR: -@GTK_MENU_FACTORY_OPTION_MENU: - + -Sets one of the two font filters, to limit the fonts shown. + -@fontsel: a #GtkFontSelection. -@filter_type: which of the two font filters to set, either -#GTK_FONT_FILTER_BASE or #GTK_FONT_FILTER_USER. The user filter -can be changed by the user, but the base filter is permanent. -@font_type: the types of font to be shown. This is a bitwise combination of -#GTK_FONT_BITMAP, #GTK_FONT_SCALABLE and #GTK_FONT_SCALABLE_BITMAP, -or #GTK_FONT_ALL to show all three font types. -@foundries: a NULL-terminated array of strings containing foundry names which -will be shown, or NULL to show all foundries. -@weights: a NULL-terminated array of strings containing weight names which -will be shown, or NULL to show all weights. -@slants: a NULL-terminated array of strings containing slant names which -will be shown, or NULL to show all slants. -@setwidths: a NULL-terminated array of strings containing setwidth names which -will be shown, or NULL to show all setwidths. -@spacings: a NULL-terminated array of strings containing spacings which -will be shown, or NULL to show all spacings. -@charsets: a NULL-terminated array of strings containing charset names which -will be shown, or NULL to show all charsets. +@w: +@v: +@widget: +@visual: - + + + + + + + + +Convert a gtk type into its sequence number + + +@type: + + -@obj: - + -No idea. + +@GTK_MENU_FACTORY_MENU: +@GTK_MENU_FACTORY_MENU_BAR: +@GTK_MENU_FACTORY_OPTION_MENU: - + -@textview: the object which received the signal. - + -@object: -@func: -@func_data: -@args: - + +@obj: - + - + + + + + @textview: the object which received the signal. - + + +Deprecated. + + + + @@ -451,61 +501,80 @@ No idea. @func_data: @args: - + -@textview: the object which received the signal. -@arg1: -@arg2: - + -@v: -@visual: +@buffer: +@time: +@interactive: +@default_editable: - + + + +@GTK_TEXT_MOVEMENT_CHAR: +@GTK_TEXT_MOVEMENT_POSITIONS: +@GTK_TEXT_MOVEMENT_WORD: +@GTK_TEXT_MOVEMENT_WRAPPED_LINE: +@GTK_TEXT_MOVEMENT_LINE: +@GTK_TEXT_MOVEMENT_LINE_ENDS: +@GTK_TEXT_MOVEMENT_BUFFER_ENDS: - + -Hide the name of gtk_identifier_get_type + +@object: +@func: +@func_data: +@args: - + -@error_code: - + -A structure used to return values from @gtk_type_query. + -@type: -@type_name: -@object_size: -@class_size: +@obj: - + -@object: -@func: -@func_data: -@args: +@factory: +@entries: +@nentries: - + + + + + +@buffer: +@iter: +@str: +@start: +@end: +@Returns: + + @@ -515,7 +584,7 @@ A structure used to return values from @gtk_type_query. @func_data: @args: - + @@ -525,13 +594,17 @@ A structure used to return values from @gtk_type_query. @func_data: @args: - + -The first "flat" (no struct) enumerated type value. +Internal function used by #GtkHPaned and #GtkVPaned +@paned: +@allocation: +@child1_req: +@child2_req: - + @@ -541,136 +614,159 @@ The first "flat" (no struct) enumerated type value. @func_data: @args: - + -@window: -@focus: - + - +Private: print debugging information while doing a gtk_object_ref() or +a gtk_object_unref(). -@wid: -@flag: +@object: object to reference or unreference. +@func: name of caller's function to print (used within macros). +@dummy: unused. +@line: line number (used within macros). +@do_ref: whether to reference or unreference. - + - +Use to get the value of a GtkArg whose GtkType is GTK_TYPE_CALLBACK +@a: - + - + -Use to get the value of a GtkArg whose GtkType is GTK_TYPE_C_CALLBACK +A set of bit flags used to specify the type of fonts shown +when calling gtk_font_selection_dialog_set_filter() or +gtk_font_selection_set_filter(). -@a: +@GTK_FONT_BITMAP: bitmap fonts. +@GTK_FONT_SCALABLE: scalable fonts. +@GTK_FONT_SCALABLE_BITMAP: scaled bitmap fonts. +@GTK_FONT_ALL: a bitwise combination of all of the above. - + - +The last structured enumerated type value. - + -Return the pointer to the type's children's types. +Get the number of signals defined by this object. -@type: GtkType -@Returns: pointer to a GList +@obj: the object to query. - + -@wid: +@factory: +@subfactory: +@path: - + - +Return the pointer to the type's children's types. -@factory: -@entries: -@nentries: +@type: GtkType +@Returns: pointer to a GList - + - +Register a new set of flags @values and give them the name in +@type_name. -@obj: +@type_name: must not be null. +@values: GtkFlagValue* +@Returns: - + -Get the type of GtkIdentifier. + -@Returns: GtkType -- the enumerated type of something. +@textview: the object which received the signal. +@arg1: - + -Given a @type, describe all of its children, and their children. Only -show the size if @show_size is true. + -@type: GtkType -@show_size: gboolean +@widget: +@selection: - + -@path: -@widget: +@PRIVATE_GTK_USER_STYLE: +@PRIVATE_GTK_RESIZE_PENDING: +@PRIVATE_GTK_RESIZE_NEEDED: +@PRIVATE_GTK_LEAVE_PENDING: +@PRIVATE_GTK_HAS_SHAPE_MASK: +@PRIVATE_GTK_IN_REPARENT: +@PRIVATE_GTK_DIRECTION_SET: +@PRIVATE_GTK_DIRECTION_LTR: - + -Returns whether a connection id is valid (and optionally not blocked). +Set the mem_chunk size so it will hold @n_chunks of the objects of that @type. -@object: the object to search for the desired handler. -@handler_id: the connection id. -@may_be_blocked: whether it is acceptable to return a blocked -handler. -@Returns: TRUE if the signal exists and wasn't blocked, -unless #may_be_blocked was specified. FALSE otherwise. +@type: There must be an unlocked TypeNode associated with this type otherwise nothing happens. +@n_chunks: - + -Convert a gtk type into its sequence number +The first structured enumerated type value. -@type: - + -Use to get the value of a GtkArg whose GtkType is GTK_TYPE_CALLBACK +This structure contains all the information about a particular +signal: its name, the type it affects, the signature of the handlers, +and its unique identifying integer. -@a: +@object_type: +@signal_id: +@signal_name: +@is_user_signal: +@signal_flags: +@return_val: +@nparams: +@params: - + - +Given a @type, describe all of its children, and their children. Only +show the size if @show_size is true. -@obj: +@type: GtkType +@show_size: gboolean - + @@ -680,43 +776,45 @@ Use to get the value of a GtkArg whose GtkType is GTK_TYPE_CALLBACK @func_data: @args: - + - + +@window: +@xid: - + -Register a new set of enum @values and give them the name in -@type_name. + -@type_name: must not be null. -@values: GtkEnumValue* -@Returns: +@object: +@func: +@func_data: +@args: - + +@iter: +@pixmap: +@mask: +@Returns: - + -@object: -@func: -@func_data: -@args: @@ -743,119 +841,64 @@ will be shown, or NULL to show all spacings. @charsets: a NULL-terminated array of strings containing charset names which will be shown, or NULL to show all charsets. - - -Use to get the value of a GtkArg whose GtkType is GTK_TYPE_C_FOREIGN - - -@a: - - - - - - -@v: -@visual: - - - - - - -@PRIVATE_GTK_USER_STYLE: -@PRIVATE_GTK_RESIZE_PENDING: -@PRIVATE_GTK_RESIZE_NEEDED: -@PRIVATE_GTK_LEAVE_PENDING: -@PRIVATE_GTK_HAS_SHAPE_MASK: -@PRIVATE_GTK_IN_REPARENT: -@PRIVATE_GTK_DIRECTION_SET: -@PRIVATE_GTK_DIRECTION_LTR: - - - - - - -@mark: - - - -Obtain information about a signal. - - -@signal_id: the signal type identifier. -@Returns: a pointer to a GtkSignalQuery structure -which contains all the information, or NULL. -The pointer is allocated just for you: you must g_free() it. - - + -@object: -@func: -@func_data: -@args: - - - - +@textview: the object which received the signal. +@arg1: +@arg2: - + -@mark: @Returns: - + - +No idea. -@buffer: -@time: -@interactive: -@default_editable: - + - +Combine a fundemantal type and a sequence number to create a gtk type. +@parent_t: +@seqno: - - -Given the type of an object and a pointer to it, the object is freed. - + +Functions to adapt C structures to native calling convention. -@type: GtkType -@mem: gpointer to the object - + - +The last "flat" (no struct) enumerated type value. -@buffer: -@time: - + +@mark: - + +@object: +@func: +@func_data: +@args: - + @@ -865,151 +908,132 @@ Given the type of an object and a pointer to it, the object is freed. @func_data: @args: - + - +Destroy all the signal handlers connected to an object. +This is done automatically when the object is destroyed. - - - - +This function is labeled private. -@factory: -@paths: -@npaths: +@object: the object whose signal handlers should be destroyed. - + -@factory: +@iter: +@start: +@end: +@Returns: - + -The last structured enumerated type value. +Get the varargs type associated with @foreign_type +@foreign_type: GtkType +@Returns: GtkType - + +@path: +@type: +@accel_group: +@widget: +@subfactories: - + -Print the types @type inherits from. + -@type: GtkType +@textview: the object which received the signal. +@arg1: +@arg2: - + - +Use to get the value of a GtkArg whose GtkType is GTK_TYPE_C_FOREIGN -@selection_data: -@str: -@Returns: +@a: - + @textview: the object which received the signal. -@arg1: -@arg2: - + -@Returns: +@wid: +@flag: - + -@obj: +@ruler: the gtkruler - + -@object: -@func: -@func_data: -@args: +@obj: - + -@object: -@func: -@func_data: -@args: +@GTK_DEBUG_OBJECTS: +@GTK_DEBUG_MISC: +@GTK_DEBUG_SIGNALS: +@GTK_DEBUG_DND: +@GTK_DEBUG_PLUGSOCKET: - + +@factory: +@paths: +@npaths: - + - +Given a type, return various interesting parameters of the type. -@window: -@xid: +@type: GtkType +@Returns: GtkTypeQuery* - + -@object: -@func: -@func_data: -@args: - - - -Find out the recursion depth of emissions for a particular type -of signal and object. (So it will -always return 0 or 1 if #GTK_RUN_NO_RECURSE is specified) -This is a way to avoid recursion: you can see if -you are currently running in that signal handler and emit it only -if you are. - -Another way to look at it is that this number increases -by one when #gtk_signal_emit(), et al, are called, -and decreases by one when #gtk_signal_emit() returns. - - -@object: the object with the signal handler. -@signal_id: the signal id. -@Returns: the recursion depth of emissions of this signal for this -object. - + - +Hide the name of gtk_identifier_get_type -@type: -@action: - + @@ -1019,72 +1043,59 @@ object. @func_data: @args: - - -Deprecated. - - - - + - + -Given a type, return various interesting parameters of the type. +Returns whether a connection id is valid (and optionally not blocked). -@type: GtkType -@Returns: GtkTypeQuery* +@object: the object to search for the desired handler. +@handler_id: the connection id. +@may_be_blocked: whether it is acceptable to return a blocked +handler. +@Returns: TRUE if the signal exists and wasn't blocked, +unless #may_be_blocked was specified. FALSE otherwise. - + -@textview: the object which received the signal. +@wid: - + -Controls whether opacity can be set with the #GtkColorSelection. -If this functionality is enabled, the necessary additional widgets -are added to the #GtkColorSelection and the opacity value can be -retrieved via the fourth value in the color array returned by -the gtk_color_selection_get_color() function. + -@colorsel: a #GtkColorSelection. -@use_opacity: a boolean indicating whether the opacity selection -is enabled. +@selection_data: +@Returns: - - -This is currently a hack left in for a scheme wrapper library. -It may be removed. - + -Don't use it. + -@object: The object which emits the signal. -@data: The user data associated with the hook. -@nparams: The number of parameters to the function. -@args: The actual values of the arguments. -@arg_types: The types of the arguments. -@return_type: The type of the return value from the function -or #GTK_TYPE_NONE for no return value. +@object: +@func: +@func_data: +@args: - + - +Given the type of an object and a pointer to it, the object is freed. -@obj: +@type: GtkType +@mem: gpointer to the object + + - -Functions to adapt C structures to native calling convention. @@ -1097,69 +1108,84 @@ Functions to adapt C structures to native calling convention. @func_data: @args: - + -@obj: +@path: +@widget: - + - + +Private Information + + + -@object: -@func: -@func_data: -@args: +@factory: +@path: +@Returns: - + -These set default functions to call when the user didn't -supply a function when connecting. (These are rarely -used, and probably only for language bindings) + + +@path: +@accelerator: +@callback: +@callback_data: +@widget: + + -By default, there are no such functions. + -@marshal_func: the function to invoke on every handlers for which there -isn't a function pointer. May be NULL. -@destroy_func: the function to invoke when each hook is destroyed. -May be NULL. +@window: +@xid: - + -A function which you can use to clean up when the -signal handler is destroyed. + + +@object: +@func: +@func_data: +@args: + + -For example, if your handler requires a few variables -that you made into a struct and allocated (using g_new() -or something), then you will probably want to free -it as soon as the hook is destroyed. This will -allow you to do that. (For this in particular -it is convenient to pass g_free() as a #GtkSignalDestroy -function). +Controls whether opacity can be set with the #GtkColorSelection. +If this functionality is enabled, the necessary additional widgets +are added to the #GtkColorSelection and the opacity value can be +retrieved via the fourth value in the color array returned by +the gtk_color_selection_get_color() function. -@data: The user data associated with the hook that is being -destroyed. +@colorsel: a #GtkColorSelection. +@use_opacity: a boolean indicating whether the opacity selection +is enabled. - + -Set the mem_chunk size so it will hold @n_chunks of the objects of that @type. + -@type: There must be an unlocked TypeNode associated with this type otherwise nothing happens. -@n_chunks: +@object: +@func: +@func_data: +@args: @@ -1175,131 +1201,112 @@ really an implementation detail). - + -@buffer: -@iter: -@pixmap: -@mask: +@model: +@flags: +@tree: +@tab_offset: +@button_pressed_node: +@button_pressed_tree: +@children: +@width: +@height: +@hadjustment: +@vadjustment: +@bin_window: +@header_window: +@anchor: +@cursor: +@cursor_drag: +@xor_gc: +@drag_pos: +@x_drag: +@prelight_node: +@prelight_tree: +@prelight_offset: +@selection: +@columns: +@column: +@header_height: - + -@GTK_TEXT_MOVEMENT_CHAR: -@GTK_TEXT_MOVEMENT_POSITIONS: -@GTK_TEXT_MOVEMENT_WORD: -@GTK_TEXT_MOVEMENT_WRAPPED_LINE: -@GTK_TEXT_MOVEMENT_LINE: -@GTK_TEXT_MOVEMENT_LINE_ENDS: -@GTK_TEXT_MOVEMENT_BUFFER_ENDS: +@obj: - + -@object: -@func: -@func_data: -@args: +@type: +@action: - + -@object: -@func: -@func_data: -@args: +@GTK_TEXT_DELETE_CHAR: +@GTK_TEXT_DELETE_HALF_WORD: +@GTK_TEXT_DELETE_WHOLE_WORD: +@GTK_TEXT_DELETE_HALF_WRAPPED_LINE: +@GTK_TEXT_DELETE_WHOLE_WRAPPED_LINE: +@GTK_TEXT_DELETE_HALF_LINE: +@GTK_TEXT_DELETE_WHOLE_LINE: +@GTK_TEXT_DELETE_WHITESPACE: +@GTK_TEXT_DELETE_WHITESPACE_LEAVE_ONE: - + - +The first "flat" (no struct) enumerated type value. - - -What are Signal Marshallers? + -Marshals are functions which all have the same prototype: -they take a #GtkObject, a #GtkSignalFunc, a #gpointer, -and an array of argument values. -The functions are names gtk_marshall_RETURNTYPE__PARAMTYPE1_PARAMTYPE2.... + + +@type: +@Returns: + + -They then call a native function: the GtkObject is the first -parameter passed in. The arguments are passed in the native -calling convention: chars, shorts, ints, longs may be packed -on the stack, or tucked in registers: it doesn't matter -because the same calling convention will be generated -inside the gtkmarshal code as is expected where you define -your handlers. + + + + -So the function named: - -gtk_marshal_BOOL__POINTER_INT_INT_UINT(GtkObject*, GtkSignalFunc, gpointer, GtkArg*); - -will call the #GtkSignalFunc assuming it was a function with signature: - -gboolean sigfunc(gpointer,gint,gint,guint); - + - - -Writing Custom Marshals + +@buffer: + + -Marshals are primarily used as arguments to gtk_signal_new(). -Sometimes, you may find that a marshaller you need isn't available -in the standard list. Then you have to write your own. +A marshaller that returns void and takes no extra parameters. + + + -If you wish to define a signal with a new type of argument list. -Suppose you want 2 pointers and 2 integers. -You would write: - -typedef int (*GtkSignal_INT__POINTER_POINTER_INT_INT)( - gpointer, gpointer, gint, gint -); -void marshal_INT__POINTER_POINTER_INT_INT(GtkObject* object, - GtkSignalFunc func, - gpointer func_data, - GtkArg* args) -{ - GtkSignal_NONE__POINTER_POINTER_INT_INT rfunc; - gint* return_val; - return_val = GTK_RETLOC_INT(args[4]); - rfunc = (GtkSignal_INT__POINTER_POINTER_INT_INT)func; - *return_val = (*rfunc)(object, - GTK_VALUE_POINTER(args[0]), - GTK_VALUE_POINTER(args[1]), - GTK_VALUE_INT(args[2]), - GTK_VALUE_INT(args[3]), - func_data); -} - - - + -A set of bit flags used to specify the filter being set -when calling gtk_font_selection_dialog_set_filter() or -gtk_font_selection_set_filter(). + -@GTK_FONT_FILTER_BASE: the base filter, which can't be changed by the user. -@GTK_FONT_FILTER_USER: the user filter, which can be changed from within the -'Filter' page of the #GtkFontSelection widget. @@ -1311,143 +1318,161 @@ gtk_font_selection_set_filter(). @arg2: @arg3: - + -Get the number of signals defined by this object. + -@obj: the object to query. +@obj: - + -This structure contains all the information about a particular -signal: its name, the type it affects, the signature of the handlers, -and its unique identifying integer. + -@object_type: -@signal_id: -@signal_name: -@is_user_signal: -@signal_flags: -@return_val: -@nparams: -@params: +@buffer: +@time: - + +@mark: @Returns: - + -@GTK_DEBUG_OBJECTS: -@GTK_DEBUG_MISC: -@GTK_DEBUG_SIGNALS: -@GTK_DEBUG_DND: -@GTK_DEBUG_PLUGSOCKET: +@object: +@func: +@func_data: +@args: - + - +Get the array of signals defined for this object. -@argc: -@argv: +@obj: the object to fetch the signals from. - + +gtkenums.sgml + + + +@object: +@func: +@func_data: +@args: - + - +Given a pointer to a GtkTypeObject @type_object, and a GtkType @cast_type, +make sure that it's okay to cast @type_object into a @cast_type. -@window: -@defaultw: +@type_object: GtkTypeObject* +@cast_type: GtkType +@Returns: the same GtkTypeObject* as @type_object - + +@widget: +@user_data: - + +@error_code: - + +@object: +@func: +@func_data: +@args: - + -Get the varargs type associated with @foreign_type + -@foreign_type: GtkType -@Returns: GtkType - + -@text_view: -@iter: -@x: -@y: - + -Find out the recursion depth of emissions for a particular type -of signal and object. Just like gtk_signal_n_emissions() -except it will lookup the signal id for you. +Set the varargs type for a fundamental type @foreign_type. -@object: the object with the signal handler. -@name: the signal name. -@Returns: the recursion depth of emissions of this signal for this -object. +@foreign_type: Must be a GtkType with a sequence number of zero. Must not be a +fundamental type. +@varargs_type: Must be a GtkType which is either structured or flag, or NONE. - + - +Given a GtkTypeClass pointer @klass, and a GtkType @cast_type, make +sure that it's okay to cast something of that @klass into a @cast_type. -@container: +@klass: GtkTypeClass* +@cast_type: GtkType +@Returns: Always return @klass. - + -Internal function. + +@factory: - + -The last "flat" (no struct) enumerated type value. +Find out the recursion depth of emissions for a particular type +of signal and object. (So it will +always return 0 or 1 if #GTK_RUN_NO_RECURSE is specified) +This is a way to avoid recursion: you can see if +you are currently running in that signal handler and emit it only +if you are. + +Another way to look at it is that this number increases +by one when #gtk_signal_emit(), et al, are called, +and decreases by one when #gtk_signal_emit() returns. +@object: the object with the signal handler. +@signal_id: the signal id. +@Returns: the recursion depth of emissions of this signal for this +object. - + -@window: -@xid: +@buffer: +@iter: +@pixmap: +@mask: @@ -1459,66 +1484,116 @@ The last "flat" (no struct) enumerated type value. @func_data: @args: - + -Register a new set of flags @values and give them the name in -@type_name. + -@type_name: must not be null. -@values: GtkFlagValue* -@Returns: +@object: +@func: +@func_data: +@args: - + + +Use to get the value of a GtkArg whose GtkType is GTK_TYPE_ARGS + + +@a: + + -@textview: the object which received the signal. -@arg1: -@arg2: +@factory: +@entries: +@nentries: - + + +These set default functions to call when the user didn't +supply a function when connecting. (These are rarely +used, and probably only for language bindings) + + +By default, there are no such functions. + + +@marshal_func: the function to invoke on every handlers for which there +isn't a function pointer. May be NULL. +@destroy_func: the function to invoke when each hook is destroyed. +May be NULL. + + -@type: @Returns: - - + + +Print the types @type inherits from. + +@type: GtkType - + -@w: -@v: -@widget: -@visual: +@buffer: +@text: - + + +A set of bit flags used to specify the filter being set +when calling gtk_font_selection_dialog_set_filter() or +gtk_font_selection_set_filter(). + + +@GTK_FONT_FILTER_BASE: the base filter, which can't be changed by the user. +@GTK_FONT_FILTER_USER: the user filter, which can be changed from within the +'Filter' page of the #GtkFontSelection widget. + + -A marshaller that returns void and takes no extra parameters. +Return the class of the parent. Initialize the class if necessary. +Return NULL if anything goes wrong. +@type: GtkType +@Returns: gpointer to the klass. - - + + +A function which you can use to clean up when the +signal handler is destroyed. + + +For example, if your handler requires a few variables +that you made into a struct and allocated (using g_new() +or something), then you will probably want to free +it as soon as the hook is destroyed. This will +allow you to do that. (For this in particular +it is convenient to pass g_free() as a #GtkSignalDestroy +function). + +@data: The user data associated with the hook that is being +destroyed. - + -@buffer: -@text: +@window: +@defaultw: - + @@ -1528,46 +1603,27 @@ A marshaller that returns void and takes no extra parameters. @func_data: @args: - - -Return the class of the parent. Initialize the class if necessary. -Return NULL if anything goes wrong. - - -@type: GtkType -@Returns: gpointer to the klass. - - + @obj: - + -@GTK_TEXT_DELETE_CHAR: -@GTK_TEXT_DELETE_HALF_WORD: -@GTK_TEXT_DELETE_WHOLE_WORD: -@GTK_TEXT_DELETE_HALF_WRAPPED_LINE: -@GTK_TEXT_DELETE_WHOLE_WRAPPED_LINE: -@GTK_TEXT_DELETE_HALF_LINE: -@GTK_TEXT_DELETE_WHOLE_LINE: -@GTK_TEXT_DELETE_WHITESPACE: -@GTK_TEXT_DELETE_WHITESPACE_LEAVE_ONE: - + -@buffer: -@Returns: +@obj: - + @@ -1577,7 +1633,7 @@ Return NULL if anything goes wrong. @func_data: @args: - + @@ -1587,140 +1643,124 @@ Return NULL if anything goes wrong. @func_data: @args: - + -@factory: -@entries: -@nentries: +@object: +@func: +@func_data: +@args: - + -Given a GtkTypeClass pointer @klass, and a GtkType @cast_type, make -sure that it's okay to cast something of that @klass into a @cast_type. + -@klass: GtkTypeClass* -@cast_type: GtkType -@Returns: Always return @klass. +@object: +@func: +@func_data: +@args: - + - + -@selection_data: -@Returns: +@object: +@func: +@func_data: +@args: - + - +Internal function. -@widget: -@user_data: - + - +Obtain information about a signal. +@signal_id: the signal type identifier. +@Returns: a pointer to a GtkSignalQuery structure +which contains all the information, or NULL. +The pointer is allocated just for you: you must g_free() it. - + - +Find out the recursion depth of emissions for a particular type +of signal and object. Just like gtk_signal_n_emissions() +except it will lookup the signal id for you. +@object: the object with the signal handler. +@name: the signal name. +@Returns: the recursion depth of emissions of this signal for this +object. - + -@factory: -@subfactory: -@path: - - -Debugging - - + -Given a pointer to a GtkTypeObject @type_object, and a GtkType @cast_type, -make sure that it's okay to cast @type_object into a @cast_type. + -@type_object: GtkTypeObject* -@cast_type: GtkType -@Returns: the same GtkTypeObject* as @type_object +@textview: the object which received the signal. +@arg1: +@arg2: - + -@ruler: the gtkruler - + -@model: -@flags: -@tree: -@tab_offset: -@button_pressed_node: -@button_pressed_tree: -@children: -@width: -@height: -@hadjustment: -@vadjustment: -@bin_window: -@header_window: -@anchor: -@cursor: -@cursor_drag: -@xor_gc: -@drag_pos: -@x_drag: -@prelight_node: -@prelight_tree: -@prelight_offset: -@selection: -@columns: -@column: -@header_height: +@v: +@visual: - + +@container: - + +GtkIMContextSimple + + + - + - +Use to get the value of a GtkArg whose GtkType is GTK_TYPE_C_CALLBACK +@a: - + @@ -1730,54 +1770,29 @@ make sure that it's okay to cast @type_object into a @cast_type. @func_data: @args: - - -Destroy all the signal handlers connected to an object. -This is done automatically when the object is destroyed. - - -This function is labeled private. - - -@object: the object whose signal handlers should be destroyed. - - + -@iter: -@pixmap: -@mask: -@Returns: - - - - - - - -Get the array of signals defined for this object. - - -@obj: the object to fetch the signals from. +@textview: the object which received the signal. +@arg1: +@arg2: +@arg3: - + -@object: -@func: -@func_data: -@args: - + -@iter: +@buffer: +@regexp: @start: @end: @Returns: @@ -1791,34 +1806,19 @@ Get the array of signals defined for this object. @subfactory: @path: - - - - - -@path: -@accelerator: -@callback: -@callback_data: -@widget: - - + -@ruler: the gtkruler +@GTK_TEXT_SCROLL_TO_TOP: +@GTK_TEXT_SCROLL_TO_BOTTOM: +@GTK_TEXT_SCROLL_PAGE_DOWN: +@GTK_TEXT_SCROLL_PAGE_UP: - + - - -Use to get the value of a GtkArg whose GtkType is GTK_TYPE_ARGS - - -@a: - diff --git a/docs/reference/gtk/tmpl/gtkdialog.sgml b/docs/reference/gtk/tmpl/gtkdialog.sgml index 2e835e982f..65968c1bfa 100644 --- a/docs/reference/gtk/tmpl/gtkdialog.sgml +++ b/docs/reference/gtk/tmpl/gtkdialog.sgml @@ -153,6 +153,14 @@ gtk_window_set_title(). See the #GtkWindow section for more). @GTK_RESPONSE_NONE: @GTK_RESPONSE_REJECT: @GTK_RESPONSE_ACCEPT: +@GTK_RESPONSE_DELETE_EVENT: +@GTK_RESPONSE_OK: +@GTK_RESPONSE_CANCEL: +@GTK_RESPONSE_CLOSE: +@GTK_RESPONSE_YES: +@GTK_RESPONSE_NO: +@GTK_RESPONSE_APPLY: +@GTK_RESPONSE_HELP: @@ -202,6 +210,7 @@ directly, but into the vbox and action_area, as described above. @dialog: @button_text: @response_id: +@Returns: diff --git a/gtk/gtkcolorseldialog.c b/gtk/gtkcolorseldialog.c index 6effba012e..3b1322c947 100644 --- a/gtk/gtkcolorseldialog.c +++ b/gtk/gtkcolorseldialog.c @@ -28,6 +28,7 @@ #include "gtkframe.h" #include "gtkhbbox.h" #include "gtkbutton.h" +#include "gtkstock.h" #include "gtkintl.h" @@ -79,10 +80,7 @@ gtk_color_selection_dialog_class_init (GtkColorSelectionDialogClass *klass) static void gtk_color_selection_dialog_init (GtkColorSelectionDialog *colorseldiag) { - GtkWidget *action_area_button_box, *frame; - - gtk_widget_set_colormap (GTK_WIDGET (colorseldiag), gdk_rgb_get_cmap ()); - gtk_widget_push_colormap (gdk_rgb_get_cmap ()); + GtkWidget *action_area_button_box, *frame; frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE); @@ -96,29 +94,21 @@ gtk_color_selection_dialog_init (GtkColorSelectionDialog *colorseldiag) gtk_container_add (GTK_CONTAINER (frame), colorseldiag->colorsel); gtk_widget_show (colorseldiag->colorsel); - action_area_button_box = gtk_hbutton_box_new (); - gtk_button_box_set_layout (GTK_BUTTON_BOX(action_area_button_box), GTK_BUTTONBOX_END); - gtk_button_box_set_spacing (GTK_BUTTON_BOX(action_area_button_box), 5); - gtk_box_pack_end (GTK_BOX (GTK_DIALOG (colorseldiag)->action_area), action_area_button_box, TRUE, TRUE, 0); - gtk_widget_show (action_area_button_box); - - colorseldiag->ok_button = gtk_button_new_with_label (_("OK")); - GTK_WIDGET_SET_FLAGS (colorseldiag->ok_button, GTK_CAN_DEFAULT); - gtk_box_pack_start (GTK_BOX (action_area_button_box), colorseldiag->ok_button, TRUE, TRUE, 0); + action_area_button_box = GTK_DIALOG (colorseldiag)->action_area; + + colorseldiag->ok_button = gtk_dialog_add_button (GTK_DIALOG (colorseldiag), + GTK_STOCK_BUTTON_OK, + GTK_RESPONSE_OK); + gtk_widget_grab_default (colorseldiag->ok_button); - gtk_widget_show (colorseldiag->ok_button); - - colorseldiag->cancel_button = gtk_button_new_with_label (_("Cancel")); - GTK_WIDGET_SET_FLAGS (colorseldiag->cancel_button, GTK_CAN_DEFAULT); - gtk_box_pack_start (GTK_BOX (action_area_button_box), colorseldiag->cancel_button, TRUE, TRUE, 0); - gtk_widget_show (colorseldiag->cancel_button); - colorseldiag->help_button = gtk_button_new_with_label (_("Help")); - GTK_WIDGET_SET_FLAGS (colorseldiag->help_button, GTK_CAN_DEFAULT); - gtk_box_pack_start (GTK_BOX (action_area_button_box), colorseldiag->help_button, TRUE, TRUE, 0); - gtk_widget_show (colorseldiag->help_button); + colorseldiag->cancel_button = gtk_dialog_add_button (GTK_DIALOG (colorseldiag), + GTK_STOCK_BUTTON_CANCEL, + GTK_RESPONSE_CANCEL); - gtk_widget_pop_colormap (); + colorseldiag->help_button = gtk_dialog_add_button (GTK_DIALOG (colorseldiag), + GTK_STOCK_HELP, + GTK_RESPONSE_HELP); } GtkWidget* diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c index d21be69c24..2b7ef73078 100644 --- a/gtk/gtkdialog.c +++ b/gtk/gtkdialog.c @@ -129,9 +129,11 @@ gtk_dialog_init (GtkDialog *dialog) dialog->action_area = gtk_hbutton_box_new (); gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog->action_area), - GTK_BUTTONBOX_SPREAD); + GTK_BUTTONBOX_END); + + gtk_button_box_set_spacing (GTK_BUTTON_BOX (dialog->action_area), 5); - gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area), 10); + gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area), 5); gtk_box_pack_end (GTK_BOX (dialog->vbox), dialog->action_area, FALSE, TRUE, 0); gtk_widget_show (dialog->action_area); @@ -147,7 +149,7 @@ gtk_dialog_delete_event_handler (GtkWidget *widget, gpointer user_data) { /* emit response signal */ - gtk_dialog_response (GTK_DIALOG (widget), GTK_RESPONSE_NONE); + gtk_dialog_response (GTK_DIALOG (widget), GTK_RESPONSE_DELETE_EVENT); /* Do the destroy by default */ return FALSE; @@ -244,7 +246,7 @@ gtk_dialog_new_empty (const gchar *title, * GTK_STOCK_BUTTON_OK, * GTK_RESPONSE_ACCEPT, * GTK_STOCK_BUTTON_CANCEL, - * GTK_RESPONSE_NONE, + * GTK_RESPONSE_REJECT, * NULL); * * @@ -373,10 +375,12 @@ gtk_dialog_add_action_widget (GtkDialog *dialog, * Adds a button with the given text (or a stock button, if @button_text is a * stock ID) and sets things up so that clicking the button will emit the * "response" signal with the given @response_id. The button is appended to the - * end of the dialog's action area. - * + * end of the dialog's action area. The button widget is returned, but usually + * you don't need it. + * + * Return value: the button widget that was added **/ -void +GtkWidget* gtk_dialog_add_button (GtkDialog *dialog, const gchar *button_text, gint response_id) @@ -389,11 +393,15 @@ gtk_dialog_add_button (GtkDialog *dialog, button = gtk_button_new_stock (button_text, gtk_window_get_default_accel_group (GTK_WINDOW (dialog))); + GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); + gtk_widget_show (button); gtk_dialog_add_action_widget (dialog, button, response_id); + + return button; } static void @@ -491,7 +499,7 @@ shutdown_loop (RunInfo *ri) } static void -run_destroy_handler (GtkDialog *dialog, gpointer data) +run_unmap_handler (GtkDialog *dialog, gpointer data) { RunInfo *ri = data; @@ -542,7 +550,7 @@ run_delete_handler (GtkDialog *dialog, * During gtk_dialog_run(), the default behavior of "delete_event" is * disabled; if the dialog receives "delete_event", it will not be * destroyed as windows usually are, and gtk_dialog_run() will return - * GTK_RESPONSE_NONE. Also, during gtk_dialog_run() the dialog will be + * GTK_RESPONSE_DELETE_EVENT. Also, during gtk_dialog_run() the dialog will be * modal. You can force gtk_dialog_run() to return at any time by * calling gtk_dialog_response() to emit the "response" * signal. Destroying the dialog during gtk_dialog_run() is a very bad @@ -597,8 +605,8 @@ gtk_dialog_run (GtkDialog *dialog) destroy_handler = gtk_signal_connect (GTK_OBJECT (dialog), - "destroy", - GTK_SIGNAL_FUNC (run_destroy_handler), + "unmap", + GTK_SIGNAL_FUNC (run_unmap_handler), &ri); delete_handler = diff --git a/gtk/gtkdialog.h b/gtk/gtkdialog.h index fb8d10cf6c..6135908d05 100644 --- a/gtk/gtkdialog.h +++ b/gtk/gtkdialog.h @@ -46,23 +46,39 @@ typedef enum /* Convenience enum to use for action_id's. Positive values are * totally user-interpreted. GTK will sometimes return - * GTK_ACTION_NONE if no action_id is available. + * GTK_RESPONSE_NONE if no response_id is available. * * Typical usage is: - * if (gtk_dialog_run(dialog) == GTK_ACTION_ACCEPT) + * if (gtk_dialog_run(dialog) == GTK_RESPONSE_ACCEPT) * blah(); */ typedef enum { /* GTK returns this if a response widget has no response_id, - * or the dialog gets destroyed with no response + * or if the dialog gets programmatically hidden or destroyed. */ GTK_RESPONSE_NONE = -1, + /* GTK won't return these unless you pass them in - * as the response for an action widget + * as the response for an action widget. They are + * for your convenience. */ GTK_RESPONSE_REJECT = -2, - GTK_RESPONSE_ACCEPT = -3 + GTK_RESPONSE_ACCEPT = -3, + + /* If the dialog is deleted. */ + GTK_RESPONSE_DELETE_EVENT = -4, + + /* These are returned from GTK dialogs, and you can also use them + * yourself if you like. + */ + GTK_RESPONSE_OK = -5, + GTK_RESPONSE_CANCEL = -6, + GTK_RESPONSE_CLOSE = -7, + GTK_RESPONSE_YES = -8, + GTK_RESPONSE_NO = -9, + GTK_RESPONSE_APPLY = -10, + GTK_RESPONSE_HELP = -11 } GtkResponseType; @@ -102,17 +118,15 @@ GtkWidget* gtk_dialog_new_with_buttons (const gchar *title, const gchar *first_button_text, ...); -void gtk_dialog_add_action_widget (GtkDialog *dialog, - GtkWidget *child, - gint response_id); - -void gtk_dialog_add_button (GtkDialog *dialog, - const gchar *button_text, - gint response_id); - -void gtk_dialog_add_buttons (GtkDialog *dialog, - const gchar *first_button_text, - ...); +void gtk_dialog_add_action_widget (GtkDialog *dialog, + GtkWidget *child, + gint response_id); +GtkWidget* gtk_dialog_add_button (GtkDialog *dialog, + const gchar *button_text, + gint response_id); +void gtk_dialog_add_buttons (GtkDialog *dialog, + const gchar *first_button_text, + ...); /* Emit response signal */ void gtk_dialog_response (GtkDialog *dialog, diff --git a/gtk/gtkfilesel.c b/gtk/gtkfilesel.c index 70cc81aadb..ae80fbf0d6 100644 --- a/gtk/gtkfilesel.c +++ b/gtk/gtkfilesel.c @@ -58,6 +58,7 @@ #include "gtklistitem.h" #include "gtkmain.h" #include "gtkscrolledwindow.h" +#include "gtkstock.h" #include "gtksignal.h" #include "gtkvbox.h" #include "gtkmenu.h" @@ -443,7 +444,7 @@ gtk_file_selection_get_type (void) (GtkClassInitFunc) NULL, }; - file_selection_type = gtk_type_unique (GTK_TYPE_WINDOW, &filesel_info); + file_selection_type = gtk_type_unique (GTK_TYPE_DIALOG, &filesel_info); } return file_selection_type; @@ -456,7 +457,7 @@ gtk_file_selection_class_init (GtkFileSelectionClass *class) object_class = (GtkObjectClass*) class; - parent_class = gtk_type_class (GTK_TYPE_WINDOW); + parent_class = gtk_type_class (GTK_TYPE_DIALOG); object_class->destroy = gtk_file_selection_destroy; } @@ -470,17 +471,18 @@ gtk_file_selection_init (GtkFileSelection *filesel) GtkWidget *confirm_area; GtkWidget *pulldown_hbox; GtkWidget *scrolled_win; - + GtkDialog *dialog; + char *dir_title [2]; char *file_title [2]; + + dialog = GTK_DIALOG (filesel); filesel->cmpl_state = cmpl_init_state (); /* The dialog-sized vertical box */ - filesel->main_vbox = gtk_vbox_new (FALSE, 10); + filesel->main_vbox = dialog->vbox; gtk_container_set_border_width (GTK_CONTAINER (filesel), 10); - gtk_container_add (GTK_CONTAINER (filesel), filesel->main_vbox); - gtk_widget_show (filesel->main_vbox); /* The horizontal box containing create, rename etc. buttons */ filesel->button_area = gtk_hbutton_box_new (); @@ -555,28 +557,23 @@ gtk_file_selection_init (GtkFileSelection *filesel) gtk_widget_show (filesel->action_area); /* The OK/Cancel button area */ - confirm_area = gtk_hbutton_box_new (); - gtk_button_box_set_layout (GTK_BUTTON_BOX (confirm_area), GTK_BUTTONBOX_END); - gtk_button_box_set_spacing (GTK_BUTTON_BOX (confirm_area), 5); - gtk_box_pack_end (GTK_BOX (filesel->main_vbox), confirm_area, FALSE, FALSE, 0); - gtk_widget_show (confirm_area); + confirm_area = dialog->action_area; /* The OK button */ - filesel->ok_button = gtk_button_new_with_label (_("OK")); - GTK_WIDGET_SET_FLAGS (filesel->ok_button, GTK_CAN_DEFAULT); - gtk_box_pack_start (GTK_BOX (confirm_area), filesel->ok_button, TRUE, TRUE, 0); + filesel->ok_button = gtk_dialog_add_button (dialog, + GTK_STOCK_BUTTON_OK, + GTK_RESPONSE_OK); + gtk_widget_grab_default (filesel->ok_button); - gtk_widget_show (filesel->ok_button); /* The Cancel button */ - filesel->cancel_button = gtk_button_new_with_label (_("Cancel")); - GTK_WIDGET_SET_FLAGS (filesel->cancel_button, GTK_CAN_DEFAULT); - gtk_box_pack_start (GTK_BOX (confirm_area), filesel->cancel_button, TRUE, TRUE, 0); - gtk_widget_show (filesel->cancel_button); + filesel->cancel_button = gtk_dialog_add_button (dialog, + GTK_STOCK_BUTTON_CANCEL, + GTK_RESPONSE_CANCEL); /* The selection entry widget */ entry_vbox = gtk_vbox_new (FALSE, 2); - gtk_box_pack_end (GTK_BOX (filesel->main_vbox), entry_vbox, FALSE, FALSE, 0); + gtk_box_pack_end (GTK_BOX (filesel->main_vbox), entry_vbox, FALSE, FALSE, 2); gtk_widget_show (entry_vbox); filesel->selection_text = label = gtk_label_new (""); diff --git a/gtk/gtkfilesel.h b/gtk/gtkfilesel.h index 9fb4e8fb46..0132982d16 100644 --- a/gtk/gtkfilesel.h +++ b/gtk/gtkfilesel.h @@ -29,7 +29,7 @@ #include -#include +#include #ifdef __cplusplus @@ -50,7 +50,7 @@ typedef struct _GtkFileSelectionClass GtkFileSelectionClass; struct _GtkFileSelection { - GtkWindow window; + GtkDialog parent_instance; GtkWidget *dir_list; GtkWidget *file_list; @@ -79,7 +79,7 @@ struct _GtkFileSelection struct _GtkFileSelectionClass { - GtkWindowClass parent_class; + GtkDialogClass parent_class; }; diff --git a/gtk/gtkfontsel.c b/gtk/gtkfontsel.c index 973bd59f6b..fa50c68a6c 100644 --- a/gtk/gtkfontsel.c +++ b/gtk/gtkfontsel.c @@ -48,6 +48,7 @@ #include "gtklabel.h" #include "gtkrc.h" #include "gtksignal.h" +#include "gtkstock.h" #include "gtktable.h" #include "gtkvbox.h" #include "gtkscrolledwindow.h" @@ -900,7 +901,8 @@ gtk_font_selection_dialog_get_type (void) (GtkClassInitFunc) NULL, }; - font_selection_dialog_type = gtk_type_unique (GTK_TYPE_WINDOW, &fontsel_diag_info); + font_selection_dialog_type = gtk_type_unique (GTK_TYPE_DIALOG, + &fontsel_diag_info); } return font_selection_dialog_type; @@ -913,12 +915,16 @@ gtk_font_selection_dialog_class_init (GtkFontSelectionDialogClass *klass) object_class = (GtkObjectClass*) klass; - font_selection_dialog_parent_class = gtk_type_class (GTK_TYPE_WINDOW); + font_selection_dialog_parent_class = gtk_type_class (GTK_TYPE_DIALOG); } static void gtk_font_selection_dialog_init (GtkFontSelectionDialog *fontseldiag) { + GtkDialog *dialog; + + dialog = GTK_DIALOG (fontseldiag); + fontseldiag->dialog_width = -1; fontseldiag->auto_resize = TRUE; @@ -930,9 +936,7 @@ gtk_font_selection_dialog_init (GtkFontSelectionDialog *fontseldiag) gtk_container_set_border_width (GTK_CONTAINER (fontseldiag), 4); gtk_window_set_policy(GTK_WINDOW(fontseldiag), FALSE, TRUE, TRUE); - fontseldiag->main_vbox = gtk_vbox_new (FALSE, 4); - gtk_widget_show (fontseldiag->main_vbox); - gtk_container_add (GTK_CONTAINER (fontseldiag), fontseldiag->main_vbox); + fontseldiag->main_vbox = dialog->vbox; fontseldiag->fontsel = gtk_font_selection_new(); gtk_container_set_border_width (GTK_CONTAINER (fontseldiag->fontsel), 4); @@ -941,34 +945,26 @@ gtk_font_selection_dialog_init (GtkFontSelectionDialog *fontseldiag) fontseldiag->fontsel, TRUE, TRUE, 0); /* Create the action area */ - fontseldiag->action_area = gtk_hbutton_box_new (); - gtk_button_box_set_layout(GTK_BUTTON_BOX(fontseldiag->action_area), - GTK_BUTTONBOX_END); - gtk_button_box_set_spacing(GTK_BUTTON_BOX(fontseldiag->action_area), 5); - gtk_box_pack_start (GTK_BOX (fontseldiag->main_vbox), - fontseldiag->action_area, FALSE, FALSE, 0); - gtk_widget_show (fontseldiag->action_area); - - fontseldiag->ok_button = gtk_button_new_with_label(_("OK")); - GTK_WIDGET_SET_FLAGS (fontseldiag->ok_button, GTK_CAN_DEFAULT); - gtk_widget_show(fontseldiag->ok_button); - gtk_box_pack_start (GTK_BOX (fontseldiag->action_area), - fontseldiag->ok_button, TRUE, TRUE, 0); - gtk_widget_grab_default (fontseldiag->ok_button); - - fontseldiag->apply_button = gtk_button_new_with_label(_("Apply")); - GTK_WIDGET_SET_FLAGS (fontseldiag->apply_button, GTK_CAN_DEFAULT); - /*gtk_widget_show(fontseldiag->apply_button);*/ - gtk_box_pack_start (GTK_BOX(fontseldiag->action_area), - fontseldiag->apply_button, TRUE, TRUE, 0); + fontseldiag->action_area = dialog->action_area; - fontseldiag->cancel_button = gtk_button_new_with_label(_("Cancel")); - GTK_WIDGET_SET_FLAGS (fontseldiag->cancel_button, GTK_CAN_DEFAULT); - gtk_widget_show(fontseldiag->cancel_button); - gtk_box_pack_start (GTK_BOX(fontseldiag->action_area), - fontseldiag->cancel_button, TRUE, TRUE, 0); + fontseldiag->ok_button = gtk_dialog_add_button (dialog, + GTK_STOCK_BUTTON_OK, + GTK_RESPONSE_OK); + gtk_widget_grab_default (fontseldiag->ok_button); + fontseldiag->apply_button = gtk_dialog_add_button (dialog, + GTK_STOCK_BUTTON_APPLY, + GTK_RESPONSE_APPLY); + gtk_widget_hide (fontseldiag->apply_button); + + fontseldiag->cancel_button = gtk_dialog_add_button (dialog, + GTK_STOCK_BUTTON_CANCEL, + GTK_RESPONSE_CANCEL); + + gtk_window_set_title (GTK_WINDOW (fontseldiag), + _("Font Selection")); + } GtkWidget* @@ -977,8 +973,9 @@ gtk_font_selection_dialog_new (const gchar *title) GtkFontSelectionDialog *fontseldiag; fontseldiag = gtk_type_new (GTK_TYPE_FONT_SELECTION_DIALOG); - gtk_window_set_title (GTK_WINDOW (fontseldiag), - title ? title : _("Font Selection")); + + if (title) + gtk_window_set_title (GTK_WINDOW (fontseldiag), title); return GTK_WIDGET (fontseldiag); } diff --git a/gtk/gtkfontsel.h b/gtk/gtkfontsel.h index 1cc0c8653b..a35ebd12fc 100644 --- a/gtk/gtkfontsel.h +++ b/gtk/gtkfontsel.h @@ -33,10 +33,9 @@ #include -#include +#include #include - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ @@ -93,7 +92,7 @@ struct _GtkFontSelectionClass struct _GtkFontSelectionDialog { - GtkWindow window; + GtkDialog parent_instance; GtkWidget *fontsel; @@ -111,7 +110,7 @@ struct _GtkFontSelectionDialog struct _GtkFontSelectionDialogClass { - GtkWindowClass parent_class; + GtkDialogClass parent_class; }; diff --git a/gtk/gtkmessagedialog.c b/gtk/gtkmessagedialog.c index 6ecb161c0b..6a74193cf2 100644 --- a/gtk/gtkmessagedialog.c +++ b/gtk/gtkmessagedialog.c @@ -150,11 +150,9 @@ setup_type(GtkMessageDialog *dialog, GtkMessageType type) * * Creates a new message dialog, which is a simple dialog with an icon * indicating the dialog type (error, warning, etc.) and some text the - * user may want to see. If the button set you select with the @buttons - * argument has positive buttons (OK, Yes) they will result in a response ID - * of GTK_RESPONSE_ACCEPT. If it has negative buttons (Cancel, No) they will - * result in a response ID of GTK_RESPONSE_REJECT. See #GtkDialog for more - * details. + * user may want to see. When the user clicks a button a "response" + * signal is emitted with response IDs from #GtkResponseType. See + * #GtkDialog for more details. * * Return value: a new #GtkMessageDialog **/ @@ -209,37 +207,37 @@ gtk_message_dialog_new (GtkWindow *parent, case GTK_BUTTONS_OK: gtk_dialog_add_button (dialog, GTK_STOCK_BUTTON_OK, - GTK_RESPONSE_ACCEPT); + GTK_RESPONSE_OK); break; case GTK_BUTTONS_CLOSE: gtk_dialog_add_button (dialog, GTK_STOCK_BUTTON_CLOSE, - GTK_RESPONSE_ACCEPT); + GTK_RESPONSE_CLOSE); break; case GTK_BUTTONS_CANCEL: gtk_dialog_add_button (dialog, GTK_STOCK_BUTTON_CANCEL, - GTK_RESPONSE_REJECT); + GTK_RESPONSE_CANCEL); break; case GTK_BUTTONS_YES_NO: gtk_dialog_add_button (dialog, GTK_STOCK_BUTTON_YES, - GTK_RESPONSE_ACCEPT); + GTK_RESPONSE_YES); gtk_dialog_add_button (dialog, GTK_STOCK_BUTTON_NO, - GTK_RESPONSE_REJECT); + GTK_RESPONSE_NO); break; case GTK_BUTTONS_OK_CANCEL: gtk_dialog_add_button (dialog, GTK_STOCK_BUTTON_OK, - GTK_RESPONSE_ACCEPT); + GTK_RESPONSE_OK); gtk_dialog_add_button (dialog, GTK_STOCK_BUTTON_CANCEL, - GTK_RESPONSE_REJECT); + GTK_RESPONSE_CANCEL); break; default: diff --git a/gtk/gtktexttagtable.c b/gtk/gtktexttagtable.c index 1e60c2f861..9386fd1571 100644 --- a/gtk/gtktexttagtable.c +++ b/gtk/gtktexttagtable.c @@ -107,6 +107,7 @@ gtk_text_tag_table_init (GtkTextTagTable *table) /** * gtk_text_tag_table_new: + * * Creates a new #GtkTextTagTable. The table contains no tags by * default. * diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index ee0354d9d8..bc054fb173 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -691,6 +691,7 @@ gtk_text_view_init (GtkTextView *text_view) /** * gtk_text_view_new: + * * Creates a new #GtkTextView. If you don't call gtk_text_view_set_buffer() * before using the text view, an empty default buffer will be created * for you. Get the buffer with gtk_text_view_get_buffer(). If you want -- 2.30.2